package com.wisnews.controller.sec;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.wisnews.pojo.Input;
import com.wisnews.pojo.Result;
import com.wisnews.pojo.sec.entity.ShiroRequestController;
import com.wisnews.service.sec.Impl.ShiroRequestControllerServiceImpl;
import com.wisnews.util.Constants;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description：请求权限控制类
 * @Author: yuyd
 * @Email: yyd8358@foxmail.com
 * @Date: 2020/12/29 14:50
 * @Version 1.0
 */
@RestController
@RequestMapping("/requestController")
@Slf4j
public class RequestController {

    @Autowired
    private ShiroRequestControllerServiceImpl shiroRequestControllerService;

    /**
     * @description: 获取请求权限控制信息
     * @param: input
     * @return: result
     * @author yuyd
     * @date: 2021/5/2 22:01
     */
    @RequestMapping("/getRequest")
    public Result getAllRequest(@RequestBody Input<ShiroRequestController> input){
      IPage page =  shiroRequestControllerService.queryForPage(input.getReq(),input.toPage());
        return new Result(Constants.SYS_CODE.SUCCESS,Constants.SYS_CODE.SUCCESS_MESSAGE,page);
    }

}
